package com.fengmi.mapper;

import com.fengmi.entity.MallGoodsCat;
import com.fengmi.entity.ViewCatTemp;
import com.fengmi.view.ViewCatTpl;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 123
 * @Date 2022/2/10 11:25
 * @Version 1.0
 */

public interface ViewCatTemplateMapper {
    //通过父id查询商品分类
    @Select("select * from view_cat_temp where parent_id = #{pid}")
    public List<ViewCatTemp> findCatTempByParentId(String pid);

    //保存添加类目
    @Insert("insert into mall_goods_cat (parent_id,name,template_id) " +
            "values (#{parentId},#{name},#{templateId})")
    public int saveCat(MallGoodsCat mallGoodsCat);




    @Select("select * from view_cat_tpl where parent_id=#{pid}")
    public List<ViewCatTpl> findCatByPid(String pid);
}
